
# python中类的命名采用驼峰命名
# 1. 没有出现url的映射
# 2. 没有编码和解码
class Calculater:
    def add(self, x, y):
        return x + y

    def multiply(self, x, y):
        return x * y

    def subtract(self, x, y):
        return x - y

    def divide(self, x, y):
        return x / y


if __name__ == '__main__':
    from xmlrpc.server import SimpleXMLRPCServer

    obj_calc = Calculater()
    server = SimpleXMLRPCServer(("", 8088))
    # 将实例注册给rpc server
    server.register_instance(obj_calc)
    print("Listening on port 8088")
    server.serve_forever()
